package com.cdu.model.common;

import lombok.Data;

import java.util.List;

/**
 * projectName : app3_spring2ibatis
 * className: PageResult
 * description: TODO 类描述
 *
 * @author : git.jas0nch
 * date: 2022-03-29
 */

@Data
public class PageResult<T> extends BasePage {

    private List<T> list;

    private long total;

    /**
     * @param list
     * @param pageNum
     * @param pageSize
     * @param total
     * @return : tech.cj.utils.PageResult
     * @description :
     * @author : git.jas0nch
     * date : 2022/3/29
     **/
    public static <T> PageResult doPage(List<T> list, int pageNum, int pageSize, long total) {
        PageResult result = new PageResult();
        result.setList(list);
        result.setPageNum(pageNum);
        result.setPageSize(pageSize);
        result.setTotal(total);

        return result;
    }
}
